package cmd

import (
	"fmt"
	"gitee.com/getcharzp/light-ftp/internal/service/cp"
	"github.com/spf13/cobra"
	"os"
)

type cpCommand struct {
	cmd *cobra.Command
}

func newCpCommand() *cobra.Command {
	c := new(cpCommand)
	c.cmd = &cobra.Command{
		Use:   "cp",
		Short: "file copy include upload download",
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) != 2 {
				fmt.Println("参数有且只需要两个")
				os.Exit(1)
			}
			cp.Cp(args[0], args[1])
		},
	}
	return c.cmd
}
